<?php
namespace app\royalty\controller;

use think\Controller;
use app\royalty\logic\Royalty;

class TestController extends Controller
{
    public function index()
    {
        $logic=new Royalty();
        $list1=$logic->merchant(1,100);
        if($list1 === false){
            $this->error($logic->getError());
        }
        $list2=$logic->customer(4,100);
        if($list2 === false){
            $this->error($logic->getError());
        }
        $list=array_merge($list1,$list2);

        if(!$logic->doRoyalty($list)){
            $this->error($logic->getError());
        }

        header('Content-Type: text/plain');
        echo "商家推荐分成\r\n";
        print_r($list1);
        echo "顾客推荐分成\r\n";
        print_r($list2);
        exit;
    }
}
